Developer --> Technical Publications
PATHHardware Documentation > USB Devices > Mac OS USB DDK API Reference


Code Changes Required To Support The Version 1.1 USBPB

This section describes the changes you should be aware of if you are working with code that supported the version 1.0 parameter block in USB.h and you want to take advantage of the features in version 1.1 of the Mac OS USB software.

The USBPB parameter block structure has been converted to include unions that provide support for isochronous transfers. The change is binary compatible (you can keep the same kUSBCurrentVersion value), but it is necessary to make changes to existing source code in order to use the version 1.1 USB.h file.

At the simplest level, the necessary changes can be made by doing a search and replace of the following strings in your code:

Old string

New replacement string

usbBMRequestType usb.cntl.BMRequestType
usbBRequest usb.cntl.BRequest
usbWValue usb.cntl.WValue
usbWIndex usb.cntl.WIndex

To aid with the conversion process, macros with the substitutions are available in the version 1.1 USB.h file. To use the macros, add a define for OLDUSBNAMES before including USB.h. It is recommended that you make the actual string changes in the source, because the macro facility is not guaranteed to be available in later versions of the USB.h file.

The USBClassDriverPlugInDispatchTable has changed in version 1.1. If the version of USBClassDriverPluginDispatchTable is set to kUSBClassDriverPluginVersion it indicates that USBDriverNotifyProcPtr has the following prototype:

OSStatus USBDriverNotifyProc (
                     USBDriverNotification notification,
                     void *pointer,
                     Uint32 refcon);

Drivers that were compiled with earlier versions of the USB.h header file will have a different kUSBClassDriverPluginVersion value and the USB Manager will call the USBDriverNotifyProc without the refcon parameter.

Check that the current version of USB software has isochronous support before making the USBIsocRead or USBIsocWrite calls. You must also weak link your class driver with the USBServicesLib USB.h file. If your driver makes USBIsocRead and USBIsocWrite calls and hard links to the USBServicesLib file, the system will check for support of these calls. If it finds that they are not available, the driver will not load.


© 1999 Apple Computer, Inc.

Previous | Back Up One Level | Next | Show Frames | Hide Frames